<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'AddUser.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->


<script type="text/javascript">
function check(){

 var oldpsw=document.getElementById('oldpsw');
 var newpsw1=document.getElementById('newpsw1');
 var newpsw2=document.getElementById('newpsw2');
 
 if(oldpsw.value!=("<%=session.getAttribute("password")%>")){
 alert("原密码不正确!");
 oldpsw.focus();
 return false;
 }else if(newpsw1.value!=newpsw2.value){
 alert("两次密码输入不相同!");
 newpsw2.focus();
 return false;
 }
 }
</script>
<script type="text/javascript">
	var msg ='<%=session.getAttribute("tipMessage")%>';
	if (msg != ""&&msg!=null) {
	<%session.setAttribute("tipMessage","");%>
		alert(msg);
		
	}
</script>
  </head>
  
  <body>
        <br>
        <br>
        <div align=center><FONT SIZE="6" COLOR="颜色#000000">修改密码</FONT></div>
        <br>
        <br>
        <form name="modifypsw" action="modifypsw" method="post" onsubmit="return check()">
    	<table align="center">
    	<tr align="right">
    	<td>原密码：<input type="text" id="oldpsw" size="20"></td>
    	</tr>
    	<tr align="right">
    	<td>新密 码：<input type="password" size="20" name="user.password" id="newpsw1"></td>
    	</tr>
    	<tr align="right">
    	<td>确认密码：<input type="password" id="newpsw2" size="20"></td>
    	</tr>
    	
    	
    	<tr align="center">
    
    	</tr>

    	<tr align="center">
    	<td>
    	<input type=submit name=submit2 value="确定">
    	</td>
    	</tr>
    	</table>
    	</form>
  </body>
</html>
